<?php

class QQinfo {

	public function getUserInfo($args) {
		import("OpenApiV3.php");

		// 应用基本信息
		$appid = 100681782;
		$appkey = '8c4ed2317d8823999290ea6f98672880';

		// OpenAPI的服务器IP
		// 最新的API服务器地址请参考wiki文档: http://wiki.open.qq.com/wiki/API3.0%E6%96%87%E6%A1%A3
		$server_name =API_SERVER;

		// 用户的OpenID/OpenKey
		$openid = $args['openid'];
		$openkey = $args['openkey'];

		// 所要访问的平台, pf的其他取值参考wiki文档: http://wiki.open.qq.com/wiki/API3.0%E6%96%87%E6%A1%A3
		$pf = 'qzone';
		$appargs = array($appid, $appkey);
		$sdk = spClass('OpenApiV3', $appargs);
		$sdk -> setServerName($server_name);

		$params = array('openid' => $openid, 'openkey' => $openkey, 'pf' => $pf, );

		$script_name = '/v3/user/get_info';
		$ret = $sdk -> api($script_name, $params, 'post');

		return $ret;
	}

}
?>